package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum RegistStatus {
	INDUSTRY(0,"已选择套餐"),
	BASE(1,"已注册基本信息"),
	SHOP(2,"已填写店铺信息"),
	SHOPINFO(3,"已完善证件资料"),
	AUDITSUCCESS(4,"审核通过"),
	AUDITFAIL(5,"审核不通过");
	
	private Integer status;
	
	private String value;

	private RegistStatus(Integer status,String value){
		this.status = status;
		this.value = value;
	}

	public int toIntStatus() {
		return this.status;
	}
	
	public String toStringValue() {
		return this.value;
	}

	public static RegistStatus toFlag(int status) {
		if (INDUSTRY.status == status) {
			return INDUSTRY;
		} else if (BASE.status == status) {
			return BASE;
		} else if (SHOP.status == status) {
			return SHOP;
		} else if (SHOPINFO.status == status) {
			return SHOPINFO;
		} else if (AUDITSUCCESS.status == status) {
			return AUDITSUCCESS;
		} else if (AUDITFAIL.status == status) {
			return AUDITFAIL;
		}else {
			throw new InvalidArgumentException("Unknown status[" + status + "].");
		}
	}
}
